<?php
	include('database.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Турфирма «Звездочка»</title>
		<link rel="stylesheet" href="styles/style.css" type="text/css" />
		<script type="text/javascript" src="scripts/lightbox2.04/js/prototype.js"></script>
		<script type="text/javascript" src="scripts/lightbox2.04/js/scriptaculous.js?load=effects,builder"></script>
		<script type="text/javascript" src="scripts/lightbox2.04/js/lightbox.js"></script>
		<link rel="stylesheet" href="scripts/lightbox2.04/css/lightbox.css" type="text/css" media="screen" />
		<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAW5Yb19YRqgsi8mjBor6qhRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQOhsIbSm_7MO5BMifsKwMV9TWdlQ&sensor=false&hl=ru" type="text/javascript"></script>
		<script type="text/javascript">
			function initialize() {
				if (GBrowserIsCompatible() && document.getElementById("map_canvas")) {
					var map = new GMap2(document.getElementById("map_canvas"));
					<?php
						$result = mysql_query('SELECT name, latitude, longitude FROM resorts WHERE folder = "'.$_GET['resort'].'"', $conn);
						$row = mysql_fetch_array($result);
						if ($row['latitude'] && $row['longitude']) {
							$lat = $row['latitude'];
							$lon = $row['longitude'];
							$name = $row['name'];
						} else {
							$lat = 46.966667;
							$lon = 32;
							$name = 'Николаев';
						}
					?>
					map.setCenter(new GLatLng(<?php echo $lat; ?>, <?php echo $lon; ?>), 13);
					map.setUIToDefault();
					map.setMapType(G_SATELLITE_MAP);
					map.disableScrollWheelZoom();
					map.openInfoWindowHtml(map.getCenter(), "<h2 style=\"text-align: center;\"><?php echo $name; ?></h2>");
				}
			}
		</script>
	</head>
	<body onload="initialize()">
		<div class="container">
			<div class="header">
				<a href="?"><img src="images/logo.png" alt="logo" /></a>
			</div>
			<?php if (!($_GET['page'] == 'registration')) { ?>
				<form class="login" method="post" action="">
					<label>Электропочта:
						<input type="text" name="login" />
					</label>
					<label>Пароль:
						<input type="password" name="password" />
					</label>
					<input type="submit" value="Войти" />
				</form>
			<?php } ?>
			<ul class="menu">
				<li><a href="?page=registration">Регистрация</a></li>
				<li><a href="?page=gallery">Фотографии</a></li>
				<li><a href="?page=maps">Карты</a></li>
				<li><a href="">Статистика</a></li>
			</ul>
			<div class="content">
				<?php
					if (isset($_GET['page'])) {
						include($_GET['page'].'.php');
					} else {
						include('content.txt');
					}
				?>
			</div>
			<div class="footer">
				&copy; Звёздочка, 2010
			</div>
		</div>
	</body>
</html>
